//
//  ZPScoreRuleViewController.m
//  ZPIOSEducation
//
//  Created by mini1 on 2016/12/6.
//  Copyright © 2016年 mini1. All rights reserved.
//

#import "ZPScoreRuleViewController.h"

@interface ZPScoreRuleViewController () <UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIWebView *mWebView;

@end

@implementation ZPScoreRuleViewController

#pragma mark - <viewDidLoad>
- (void)viewDidLoad {
    [super viewDidLoad];
    

    self.mWebView.delegate = self;
    
    
    
    [self setupNavigationItem];
    [self setupViewWithNib];
}

#pragma mark - <viewWillAppear>
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    
}

- (void)viewDidDisappear:(BOOL)animated {
    [self.tabBarController.tabBar setHidden:NO];
}

#pragma mark - <setupNavigationItem>
- (void)setupNavigationItem {
    self.navigationItem.title = @"积分规则";
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"zhenpin_back"] style:UIBarButtonItemStylePlain target:self action:@selector(clickBackButtonItem)];
}
- (void)clickBackButtonItem {
    
    if ([self.mWebView  canGoBack]) {
        [self.mWebView  goBack];
    }else {
        [self.navigationController  popViewControllerAnimated:YES];
    }
}

#pragma mark - <setupViewWithNib>
- (void)setupViewWithNib {
    self.view = [[[NSBundle mainBundle] loadNibNamed:@"ZPScoreRuleViewController" owner:self options:nil] lastObject];
    NSURLRequest  *request = [NSURLRequest  requestWithURL:[NSURL  URLWithString:[NSString  stringWithFormat:@"%@",APICOMMUNITY@"index.php/page/index/3"]]];
    [self  showHudithString:@"加载中..."];
    [self.mWebView  loadRequest:request];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
